<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<input type="text">
	<input type="text">
	<select id="a">
		<option value="+" >+</option>
		<option value="-">-</option>
		<option value="*">*</option>
		<option value="%">%</option>

	</select>
	<input type="button" class="button" value="提交">
	<input type="text" >
</body>
<script type="text/javascript">
	// var text1=parseInt(document.getElementById('text1').value);
	// console.log(text1);
	// var text2=document.getElementById('text2').value;
	// console.log(text2);
	var inp = document.getElementsByTagName('input')
	// var text3=parseInt(document.getElementById('text3').value);
	// console.log(text3);
	var btns=document.getElementsByClassName('button');
      btns[0].onclick=function(){
      	var c = inp[0].value;
      	console.log(c);
      	var d = inp[1].value;
      	console.log(d);
      	var e = inp[3].value;
      	console.log(e);

      	var sel = document.getElementById('a');
	    var a = sel.selectedIndex;
	    var b = sel.options[a].text;
	     console.log(b);
      	switch(b){
    	case'+':
    	e=c+d;
    	// alert(text3)
    	// console.log(text3);
    	var e = inp[3].value;
    	break;
    	case'-':
    	e=c-d;
    
    	break;
    	case'*':
    	e=c*d;
    	break;
    	case'%':
    	e=c%d;
    	break;

    }
      	
      }

    
</script>
</html>